package com.chinacoal.microservice.mapper;

import com.baomidou.mybatisplus.mapper.BaseMapper;
import com.chinacoal.microservice.pojo.CcmsSmartleasingHistoricalPayment;
import org.apache.ibatis.annotations.Param;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

/**
 * @author zhuliang
 * @version V1.0
 * @Description: 数据化中心-综合分析
 * @date 2020-12-29 14：45
 */
public interface CcmsSmartleasingHistoricalPaymentMapper extends BaseMapper<CcmsSmartleasingHistoricalPayment> {
    /**
     * @Description: 查询上个月的总收款金额
     * @author zhuliang
     * @date 2020/12/30 18:03
     */
    BigDecimal getTotal();

    /**
     * @Description: 根据费用id，累加缴费金额
     * @author zhuliang
     * @date 2020/12/31 9:49
     */
    void updateByCostId(@Param("amount") BigDecimal amount,
                        @Param("lastUpdateDate") Date lastUpdateDate,
                        @Param("lastUpdatedBy") Integer lastUpdatedBy,
                        @Param("pkExpenseManagId") String pkExpenseManagId);

    /**
     * @Description: 根据订单号，累加缴费金额
     * @author zhuliang
     * @date 2020/12/31 9:49
     */
    void updateByWechat(@Param("amount") BigDecimal amount,
                        @Param("lastUpdateDate") Date lastUpdateDate,
                        @Param("lastUpdatedBy") Integer lastUpdatedBy,
                        @Param("orderNumber") String orderNumber);

    /**
     * @Description: 根据时间区间查询历史缴费信息
     * @author zhuliang
     * @date 2020/12/31 10:44
     */
    List<CcmsSmartleasingHistoricalPayment> getAll(@Param("dateStart") String dateStart,
                                                   @Param("dateEnd") String dateEnd);

    /**
     * @Description: 得到所有有记录的年份
     * @author zhuliang
     * @date 2021/1/15 16:18
     */
    List<String> getAllYear();

    List<CcmsSmartleasingHistoricalPayment> getHistoricalPaymentsByExpenseManagId(@Param("fkExpenseManagId") String fkExpenseManagId);
}
